/*******************************************************************************
 * Copyright (c) 2009 L.Carbonnaux.
 *******************************************************************************/

package org.lcx.taskvision.core.model;

/**
 * @author Laurent Carbonnaux
 */
public class TaskVisionTaskKey {

	/**
	 * Represents the key of a string property of a task.
	 */
	public enum Key {
		TASKID("taskid"),
		SUMMARY("summary"),
		PRIORITY("priority"),
		COMPLETED("completed"),
		DESCRIPTION("description"),
		DEFAULT("default"),
		;

		public static Key fromKey(String name) {
			for (Key key : Key.values()) {
				if (key.getKey().equals(name)) {
					return key;
				}
			}
			return null;
		}

		private String key;

		Key(String key) {
			this.key = key;
		}

		@Override
		public String toString() {
			return key;
		}

		public String getKey() {
			return key;
		}
	}
	
}
